1. Field
Aspects of the present disclosure generally relate to a communication apparatus, a method for controlling the communication apparatus, and a storage medium.
2. Description of the Related Art
Wi-Fi Alliance has established a standard called the Wi-Fi Direct®). The Wi-Fi Direct® defines a protocol for determining whether a communication apparatus such as a printing apparatus and a personal computer (PC) operates as an access point or as a client. Executing this protocol makes it possible to automatically determine which communication apparatus operates as an access point and which communication apparatus operates as a client. The use of the Wi-Fi Direct® eliminates the need for preparing an access point separately and enables communication apparatuses to directly communicate with each other wirelessly.
FIG. 1 schematically illustrates a processing sequence in the Wi-Fi Direct®. A printing apparatus and a mobile terminal are examples of an information processing apparatus that supports the Wi-Fi Direct®.
In step S101, each of the printing apparatus and the mobile terminal carries out an apparatus search to identify a communication partner. Upon identifying a communication partner through the apparatus search, in step S102, the printing apparatus and the mobile terminal determine which one of the printing apparatus and the mobile terminal operates as an access point (Group Owner) and which one of the two operates as a Client. This processing in step S102 will be referred to as role determination. In FIG. 1, as a result of the role determination in step S102, the printing apparatus operates as a Group Owner, and the mobile terminal operates as a Client.
In step S103, the printing apparatus serving as a Group Owner provides, by using Wi-Fi Protected Setup (WPS) defined by Wi-Fi Alliance, the mobile terminal serving as a Client with a parameter for establishing a connection therebetween, and thus the printing apparatus and the mobile terminal share the parameter. In step S104, the printing apparatus and the mobile terminal establish a secure connection therebetween by using the parameter. Data link layer communication of the Open Systems Interconnection (OSI) reference model is being carried out until the processing in step S104 is completed.
Upon the secure connection having been established, in step S105, the printing apparatus and the mobile terminal carry out addressing for establishing Internet Protocol (IP) communication therebetween. Here, the printing apparatus serving as a Group Owner operates as a dynamic host configuration protocol (DHCP) server and provides an IP address to the mobile terminal serving as a Client. Communication of a layer higher than a network layer of the OSI reference model is available in the processing to be carried out after step S105.
Through the processing described above, wireless communication is established between the printing apparatus and the mobile terminal. The use of this wireless communication then enables the printing apparatus and the mobile terminal to directly communicate with each other without a separately prepared access point. Japanese Patent Application Laid-Open No. 2012-199884 discusses a technique for transmitting and receiving audio data and photographic data by using the Wi-Fi Direct®.
A communication apparatus can easily establish wireless communication with an external device via the Wi-Fi Direct®. By using the wireless communication established via the Wi-Fi Direct®, the communication apparatus can then use various services which the external device provides (e.g., a print service and a storage service).
Depending on an environment in which the Wi-Fi Direct® is used, however, there may be a case where a specific service is not to be provided. For example, in the case of a printing apparatus, there may be a case where the use of a print service via the Wi-Fi Direct® should be prohibited in order to limit the use of a print function to a case where a print job is submitted from a PC by using a wired local area network (LAN). Japanese Patent Application Laid-Open No. 2012-199884 discusses a technique for transmitting and receiving audio data and photographic data by using the Wi-Fi Direct®, but prohibiting the use of these functions is not taken into consideration.